Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to current bats-core #11

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Conversation

rico-chet
Copy link

The original bats repository is abandoned (no commits for years), the successor being bats-core. Over years, its development progressed, yet bats-file didn't follow, so now tests are failing due to a couple internal changes.

Luckily, fixing the tests is all that's needed, business logic isn't affected by the dependency upgrade.

To ensure backward compatibility to the old bats, additional travis environments were added so that a bunch of bats-core versions are tested at once, v0.4.0 being same as the latest bats release and the oldest version to be supported.

rico-chet added 15 commits April 4, 2020 15:01
Add line breaks and split the long installation statement.
Use a specific `bats` version instead of the moving `master` branch.
Set the version to v0.4.0 which is the latest release.
Since the original `bats` isn't maintained anymore, switch to its
successor `bats-core`.
Merge pull request #2 from rico-chet/switch-to-bats-core
Cloning was done using the `v*` pattern which works for tags only. In
future, we will need to clone a branch, too.

Extend the mechanism to branches by removing the leading `v`.
In the `fixtures()` function, a `bats`-internal function is used, namely
`bats_trim_filename()`. With the commit eaa151fb "exec-test: Use printf
-v in bats_trim_filename" (bats-core/bats-core@eaa151f) introduced in
`bats` v1.0.0, its interface was changed to take a variable name instead
of printing to `stdout`, breaking the test code.

Adapt to the incompatible change, retaining compatibility with v0.*
versions. Expect all tests to pass now.
To make use of the newest `bats-core` features, update the version.
Since a couple hurdles will occur, do it step-wise.
To make use of the newest `bats-core` features, update the version.
Since a couple hurdles will occur, do it step-wise.
To make use of the newest `bats-core` features, update the version.
Since a couple hurdles will occur, do it step-wise.
In an upcoming commit, we will test with different `bats` versions in
parallel, prepare for this by declaring a separate `v0.4.0` build
environment.
To make use of the newest `bats-core` features, update the version.
Since a couple hurdles will occur, do it step-wise.

With v1.0.0, all tests fail, so expect them to fail. This will be fixed
in an upcoming commit.
Merge pull request #4 from rico-chet/update-bats-core
To make use of the newest `bats-core` features, update the version,
ultimately.

Two tests fail, so expect them to. This will be fixed in an upcoming
commit.
Since commit 17e2cf35 "*: refactor to always use bats-exec-suite"
(bats-core/bats-core@17e2cf35), `*.bats` files without a test aren't
run at all. This leads to two checks not working properly.

Add _void_ tests to the affected files and adapt the tests to take into
account the extra line that is emitted.
Merge pull request #5 from rico-chet/update-bats-core-to-master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant